	function init() {
		$('#option').click(function () {
			chrome.tabs.create({ url: 'options.html'});
		});
		var data = localStorage.getItem('naviextrasConfig');
		var config = JSON.parse(data);
		var html="";
		var h = d = s = 0;
		names = [];
		for(system in config.systems) {
			names.push(system);
		} 
		names.sort();
		for(i in names) {
			var system = names[i];
			if (system != 'developer') {
				var value = localStorage.getItem('showServer'+system) == 'show' 
					? 'show' 
					:  localStorage.getItem('showServer'+system) == 'hide'
						? 'hide'
						: 'defa';
				h += value == 'hide' ? 1 : 0;
				s += value == 'show' ? 1 : 0;
				d += value == 'defa' ? 1 : 0;
				html += 
					'<tr class="server'+value+' menuI" style="display:none"><td><img src="images/icon16.png"></td><td>' +
							'<a target="'+system+'Shop" href="http://'+config.systems[system].base+'/shop/portal">'+system+'</a>'+
						'</td><td>'+
							'<a target="'+system+'Admin" href="http://'+config.systems[system].base+'/shopAdmin">Admin</a>'+
						'</td>'+
					'</tr>';
			}
		}
		$('#serverList').append(html);
		
		var extra = localStorage.getItem('extraServers');
		console.log('extra:'+extra);
		var configExtra = {};
		if (extra!=null) {
			configExtra = JSON.parse(extra);
		}
		var first = true;
		html = ""
		for(system in configExtra) {
			console.log(system);
			if (first) {
				html += '<tr><td colspan="100%" align="center">'+
							'<div id="separatorItem" class="separator">User Defined</div>'+
						'</td></tr>';
				first = false;
			}
			html += 
				'<tr class="menuI"><td><img src="images/icon16.png"></td><td>' +
						'<a target="'+system+'Shop" href="'+configExtra[system].base+'/shop/portal">'+system+'</a>'+
					'</td><td>'+
						'<a target="'+system+'Admin" href="'+configExtra[system].base+'/shopAdmin">Admin</a>'+
					'</td>'+
				'</tr>';
		}
		$('#serverList').append(html);
		
		$('tr.servershow').show();
		if (localStorage.settingServers != 'hide') {
			if (d>0) {
				$('tr.serverdefa').show();
			}
			if (h==0)  {
				$('#showAll').hide();
			}
		} else {
			if (d+h==0)  { 
				$('#showAll').hide();
			}
		}
		console.log(s+','+h+','+d);

		$('#ShowAll').click(function () {
			$('#showAll').hide();$('tr.serverdefa,tr.serverhide').show();
		});
	}
	$(init);
